a = [1,2,3]
b = a
print(b is a)
a[2] = 4
print(id(a),id(b))
#浅拷贝(只有一个父对象）
a = [1,2,3]
b = a.copy()
print(a is b)
a[2] = 4
print(id(a),id(b))
print(a,b)
#浅拷贝（父对象里有子对象）
a = [1,2,[3,4]]
b = a.copy()
print(id(a[0]),id(b[0]))
print(a is b)
a[2].append(5)
a[0] = 2
print(id(a),id(b))
print(id(a[2]),id(b[2]))
print(a,b)
#深拷贝
import copy
a = [1,2,[3,4]]
b = copy.deepcopy(a)
print(a is b)
print(id(a),id(b))
print(id(a[2]),id(b[2]))
a[2].append(5)
a[0]=2
print(a,b)